package com.cltech.mapper;

import com.cltech.dto.SysDicDto;
import com.cltech.entity.sys.SysDic;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * Created by Administrator on 2019/4/8.
 */
@Mapper(componentModel = "spring")
public interface SysDicMapper {
    SysDic dtoToEntity(SysDicDto sysDicDto);
    @InheritConfiguration
    List<SysDic> dtoToEntity(List<SysDicDto> sysDicDto);
    @InheritInverseConfiguration
    SysDicDto entityToDto(SysDic sysDic);
    @InheritInverseConfiguration
    List<SysDicDto> entityToDto(List<SysDic> sysDic);
    default Page<SysDicDto> entityToDto(Page<SysDic> page){
        return page.map(this::entityToDto);
    }
}
